<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,user-scalable=no">
	<title>重卡汇</title>
	<link rel="stylesheet" href="//api.hongyanche.com/css/bc-weui.css">
	<style></style>
</head>
<body ontouchstart>
	
	<div class="weui-msg">
		<BR/>
		<BR/>
		<div class="weui-msg__icon-area">
			<i style="display:none" class="weui-icon weui-icon-success weui-icon_msg"></i>
			<i style="display:none" class="weui-icon weui-icon-warn weui-icon_msg"></i>
			<img class="weui-icon_msg" style="width:93px;height:93px;border-radius:50%;background:#CECECE" src="{$userInfo.headimgurl}" />
		</div>
		<div class="weui-msg__text-area">
			<h1 class="weui-msg__title">{$userInfo.user_name} <small>#{$userInfo.user_id}</small> 您好</h1>
			<p class="weui-msg__desc">您的帐户正在进行微信验证</p>
		</div>
		<div class="weui-msg__opr-area" id="btns">
			<p class="weui-btn-area">
				<a href="javascript:void(0)" class="weui-btn weui-btn_primary">通过验证</a>
				<a style="margin-top: 10px;" href="javascript:wx.closeWindow()" class="weui-btn weui-btn_default">取消</a>
			</p>
		</div>
		<div class="weui-msg__extra-area">
			<div class="weui-footer">
				<p class="weui-footer__links">
					<a href="http://api.hongyanche.com/" class="weui-footer__link">重卡汇</a>
				</p>
				<p class="weui-footer__text">Copyright © 2016-2017 support by Tiesh.com</p>
			</div>
		</div>
	</div>
	<script src="//api.hongyanche.com/js/zepto.min.js"></script>
	<script src="//api.hongyanche.com/js/bc-weui.js"></script>
	<script>
	$(function(){
		var code = location.search.match(new RegExp("[\?\&]" + "code"+ "=([^\&]+)","i"));
		if(!code || !code.length){
			$("img").hide();
			$(".weui-icon-warn").show();
			$(".weui-msg__title").html("错误")
			$(".weui-msg__desc").html("code missing")
			$(".weui-btn").addClass("weui-btn_disabled")
			return;
		}
		code = code[1];
//        $.ajax({
//            url:'/login/qrcode_info',
//            type:'POST',
//            data:{
//                code:code,
//            },
//            success:function () {
//				alert(1)
//            }
//        });
		POST.init(".weui-btn_primary",{
			input:function(){
				return {code:code}
			},
			url:"/login/scan_confirm",
			success:function(){
				$(".toast,#btns").remove();
				$("img").hide();
				$(".weui-icon-success").show();
				$(".weui-msg__title").html("验证成功");
				$(".weui-msg__desc").html("页面关闭中.....");
				$(".weui-btn").addClass("weui-btn_disabled");
				setTimeout("wx.closeWindow();",3000);
			},
			error:function(e,errormsg){
				$(".toast,#btns").remove();
				$("img").hide();
				$(".weui-icon-warn").show();
				$(".weui-msg__title").html("验证失败")
				$(".weui-msg__desc").html(errormsg)
				$(".weui-btn").addClass("weui-btn_disabled");
			}
		});
	})
	</script>

</body>
</html>